package com.junchenrobot.mes.response.impl;

import com.junchenrobot.mes.response.BaseResponse;
import lombok.Getter;
import lombok.Setter;

/**
 * mes response2
 *
 * @author SeaWave
 * @date 2022/11/14
 */
@Getter
@Setter
public class MesResponse<S> implements BaseResponse {
    
    private String code;
    
    private String message;
    
    private S data;
    
    
    @Override
    public BaseResponse  success() {
        MesResponse<Object> mesResponse = new MesResponse<>();
        mesResponse.setCode("00000");
        mesResponse.setMessage("成功");
        return mesResponse;
    }



    @Override
    public BaseResponse success(Object data) {
        MesResponse<Object> mesResponse = new MesResponse<>();
        mesResponse.setCode("00000");
        mesResponse.setMessage("成功");
        mesResponse.setData(data);
        return mesResponse;
    }
    
    @Override
    public BaseResponse fault(Object data) {
        MesResponse<Object> mesResponse = new MesResponse<>();
        mesResponse.setCode("A0122");
        mesResponse.setMessage("失败,"+data);
        mesResponse.setData(data);
        return mesResponse;
    }

    @Override
    public Boolean getResult() {
        return null;
    }

}
